package com.ikas.ai.server.module.flow.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ikas.ai.server.module.flow.dao.FlowNodeDAO;
import com.ikas.ai.server.module.flow.model.FlowNode;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 流程节点服务类
 * @Author: qi.yilai
 * @Date: 2023/1/30 18:45
 * @Version: 1.0.0
 **/
@Service
public class FlowNodeService extends ServiceImpl<FlowNodeDAO, FlowNode> {

    /**
     * 根据流程id获取流程节点
     *
     * @param flowId
     * @return
     */
    public List<FlowNode> getNodesByFlowId(Long flowId) {
        LambdaQueryWrapper<FlowNode> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(FlowNode::getFlowId, flowId);
        return list(lambdaQueryWrapper);
    }
}
